<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Title</title>
  </head>
  
  <body>
    <input type="button" value="发送请求" onclick="sendReq()">
  </body>
  
  <script>
    function sendReq() {
      const xhr = new XMLHttpRequest();
      
      xhr.onreadystatechange = () => {
        console.log('HTTP响应的状态码：' + xhr.status);// 0 200 200 200
        console.log('HTTP响应的状态提示：' + xhr.statusText);// 空 OK OK OK
      };
      
      xhr.open('GET', 'http://localhost:9000/back_end_get/params?query_name=query');
      xhr.send(null);
    }
  </script>
</html>